package com.springboot.infrastructure.controller;

import com.springboot.infrastructure.service.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/redis")
public class ReidsUtilController {

    @Autowired
    private RedisUtil redisUtil;

    @RequestMapping("/set")
    public boolean setValue(String key, String value) {
        redisUtil.setKey(key, value);
        return true;
    }

    @RequestMapping("/get")
    public String getValue(String key) {
        String value = redisUtil.getValue(key);
        return value;
    }

}
